//
//  ViewController.m
//  cityStar
//
//  Created by joyban on 14-12-27.
//  Copyright (c) 2014年 tiny. All rights reserved.
//

#import "BindingPhoneViewController.h"

@interface BindingPhoneViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *telPhone;
@property (weak, nonatomic) IBOutlet UITextField *Verification;
@property (weak, nonatomic) IBOutlet UIButton *quedinBtn;

@end

@implementation BindingPhoneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"绑定手机";
    [self addBackButton];
    self.quedinBtn.layer.cornerRadius = 4;
    self.telPhone.placeholder = @"请输入绑定手机号";
    self.Verification.placeholder = @"请输入验证码";
    
    self.telPhone.returnKeyType = UIReturnKeyDone;
    self.telPhone.delegate = self;
    self.Verification.returnKeyType = UIReturnKeyDone;
    self.Verification.delegate = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

#pragma - mark textDeletage

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    return YES;
}


- (IBAction)Return_Action:(id)sender {
    if([self.telPhone.text isEqualToString:@""])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"手机号不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else if([self.Verification.text isEqualToString: @""]){
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"验证码不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else{
        
    }
}

- (IBAction)Yanzheng_Action:(id)sender {
    if([self.telPhone.text isEqualToString:@""])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"手机号不能为空" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }else{
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"发送成功" delegate:self cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alert show];
    }
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.telPhone resignFirstResponder];
    [self.Verification resignFirstResponder];
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
